Skip to content

Conversation

@coding-ninja-afk
Copy link

What does this PR do?

  • Adds support for configuring litellm.api_key and litellm.api_base via environment variables LITELLM_API_KEY and LITELLM_API_BASE.

Why is this useful?

  • Helps teams running LiteLLM in containerized or CI/CD environments
  • Improves developer experience by enabling .env or runtime environment injection

What's included:

  • Code change in __init__.py
  • README.md section added under Usage

Happy to iterate on feedback!

@vercel
Copy link

vercel bot commented Mar 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
litellm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Apr 6, 2025 8:04pm

Copy link
Contributor

@ishaan-jaff ishaan-jaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@krrishdholakia
Copy link
Contributor

krrishdholakia commented Mar 25, 2025

Thanks for your work @freshman829. Can you explain the problem a bit more?

You can already set the env var for any provider specific credential

@coding-ninja-afk
Copy link
Author

Thanks for your work @freshman829. Can you explain the problem a bit more?

You can already set the env var for any provider specific credential

Sure! While litellm allows provider-specific env vars, this change standardizes base-level config (api_key, api_base) across deployments—especially useful in Docker/CI environments where we don’t want to hardcode values or rely on provider-specific keys unless necessary.

@coding-ninja-afk
Copy link
Author

please add a test here's the checklist: https://docs.litellm.ai/docs/extras/contributing_code#checklist-before-submitting-a-pr

Added unit testing for my update

@CLAassistant
Copy link

CLAassistant commented Apr 22, 2025

CLA assistant check
All committers have signed the CLA.

@github-actions
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@github-actions github-actions bot added the stale label Jul 31, 2025
@github-actions github-actions bot closed this Aug 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants